<template>
	 <view class="u-wrap">
	 	<u-loading class="load" mode="circle" :show="showLoading"></u-loading>
	 </view>
</template>

<script>
	export default {
		data(){
			return {
				showLoading: true,
			}
		},
		
		onShow() {
			this.configIndexPage();
		},
		
		methods:{
			configIndexPage() {
				this.showLoading = false;
				//判断用户id是否存在
				this.$store.state.user.userInfo
				console.log('缓存用户信息', this.$store.state.user.userInfo);
				
				
				if(uni.$u.test.isEmpty(this.$store.state.user.userInfo)) {//不存在=>登录页面
				     
					uni.navigateTo({
						url:'../login/login'
					})
				}else {//首页
					uni.switchTab({
						url:'../work/work'
					})
				}
			}
			
		}
	}
</script>

<style lang="scss">
		
	.load {
		display: flex;
		align-items: center;
		justify-content: center;
		
	}
	
</style>
